//
//  MeatCartWholePigCell.m
//  PigMarket
//
//  Created by 张敬 on 2019/7/24.
//  Copyright © 2019年 pigmarket.oc. All rights reserved.
//

#import "MeatCartWholePigCell.h"
#import "MeatShopRightModel.h"


@interface MeatCartWholePigCell()


@end


@implementation MeatCartWholePigCell

- (void)setupUI
{
    self.clipsToBounds = YES;
    self.wholePigUIComponent.view = self;
}

- (void)setupLayout
{
    self.wholePigUIComponent.type = MeatFoldUILayoutType_Whole;
}


#pragma mark - setter methods

- (void)setNewsModel:(MeatShopRightModel *)newsModel{
  
    self.wholePigUIComponent.model = newsModel;
}


#pragma mark - getter methods

- (MeatWholePigUIComponent *)wholePigUIComponent{
    
    if (!_wholePigUIComponent) {
        _wholePigUIComponent = [[MeatWholePigUIComponent alloc] init];
        
        kWeakSelf(self);
        _wholePigUIComponent.chooseCartBlock = ^(UIButton *btn) {
            
            if (weakself.chooseCartBlock) {
                weakself.chooseCartBlock(btn);
            }
        };
    }
    return _wholePigUIComponent;
}

@end
